home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ahoy 1987 May
/
Ahoy_Magazine_87-05_1987_Double_L_Side_A.d64
/
Outcast Order 2
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
368b
|
11 lines
0 rem << cd41-5 >>
1 rem ==================================
2 rem commodares problem #37-2 :
3 print"[147]outcast order"
4 rem solution by
5 rem keith kushner
6 rem ==================================
10 input"n,m";n,m:dim aa(n):for t=1 to n: aa(t)=t : next t
20 for u=nto1step-1:p=int(((p+m)/u-int((p+m)/u))*u+.5):p=p-u*(p=0):print aa(p)
30 for v=p to u-1:aa(v)=aa(v+1):next v:p=p-1 : next u